# 定义一些用于转换的函数
import re

# 首字母小写
def firstLetterLower(word):
    if len(word) < 1:
        return ""
    result = word[0].lower() + word[1:]
    return result


# 首字母大写
def firstLetterUpper(word):
    if len(word) < 1:
        return ""
    result = word[0].upper() + word[1:]
    return result


# user_name转换成userName
def changeIntoHump(word):
    if len(word):
        return ""

def double(matched):
    value = matched.group('value')
    return value[1].upper()

if __name__ == '__main__':
    print(firstLetterLower(""))
    # changeIntoHump("_e")
    s = 'user_name_huhx'
    result = re.sub('(?P<value>_.)', double, s)
    print(result)
